var sign = require('./sign.js');

exports.getSchemeList = function(req,res){
	sign.dataReq(req,req.session.token,req.body,'process/schemeList','post',function(ResData){
		if(ResData!=''){
			res.send(ResData);
		}else{
			res.send('暂时没有数据');
		}
	})
}

exports.getProcessList = function(req,res){
	sign.dataReq(req,req.session.token,req.body,'process/processList','post',function(ResData){
		if(ResData!=''){
			console.log(ResData)
			res.send(ResData);
		}else{
			res.send('暂时没有数据');
		}
	})
}

exports.delScheme = function(req,res){
	console.log("删除了个啥");
	console.log(req.body);
	sign.dataReq(req,req.session.token,req.body,'process/delScheme','post',function(ResData){
		if(ResData!=''){
			res.send(ResData);
		}
	})
}


exports.saveProcessList = function(req,res){
	data = req.body;
	var p =JSON.parse(data.processList);
	  data.processList = p;
	sign.dataReq(req,req.session.token,data,'process/saveProcessList','post',function(ResData){
		if(ResData!=''){
			res.send(ResData);
		}
	})
}

// exports.getController = function(req,res){
// 	data = req.body;
// 	console.log("控制器数据");
// 	console.log(data);
// 	sign.dataReq(req,req.session.token,data,'process/getContoller','post',function(ResData){
// 	console.log(ResData);
// 		if(ResData!=''){
// 			res.send(ResData);
// 		}
// 	})
// }

exports.addProcessSchemeDemo = function(req,res){
	sign.dataReq(req,req.session.token,req.body,'process/addProcessSchemeDemo','post',function(ResData){
		if(ResData!=''){
			res.send(ResData);
		}
	})
}

exports.editProcessSchemeDemo = function(req,res){
	sign.dataReq(req,req.session.token,req.body,'process/editProcessSchemeDemo','post',function(ResData){
		if(ResData!=''){
			res.send(ResData);
		}
	})
}

exports.processParameter = function(req,res){
	sign.importfileReq(req,req.session.token,req,'process/addProcessParameter','post',function(ResData){
		if(ResData!=''){
			res.send(ResData);
		}
	})
}

